﻿// See https://aka.ms/new-console-template for more information
using AutoCommunication.Base;
using AutoCommunication.Clients;
using AutoCommunication.Helper;
using Newtonsoft.Json.Linq;
using System.Reflection;

Console.WriteLine("Hello, World!");
// DeviceModel model = new DeviceModel();

//model.AddProperties.Add(new AddProperty() { Name= "IsPlcAddress", Value="true" });
//ModbusTcpClient client = new ModbusTcpClient();
//Console.WriteLine(  client.IsPlcAddress);
//var ty = client.GetType();
//var Properties = client.GetType().GetProperties().Where(x=>x.GetCustomAttribute<AddAttribute>()!=null);
//foreach (var pinfo in Properties)
//{
//    var value = model.AddProperties.First(x => x.Name == x.Name).Value;
//    var objValue = Common.ObjToTypeValue(pinfo, value?.ToString() ?? "");
//    pinfo.SetValue(client, objValue);

//}
//Console.WriteLine(client.IsPlcAddress);

;
